package com.fun.feifun.modules.business.model;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fun.feifun.base.BaseEntity;
import com.fun.feifun.modules.business.model.dto.BusinessGoodsDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;

/**
 * <p>
 * 业务商品
 * </p>
 *
 * @author wkf
 * @since 2024-05-29
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="BusinessGoods对象", description="业务商品")
public class BusinessGoods extends BaseEntity {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "商品编码")
    private String code;

    @ApiModelProperty(value = "商品名称")
    private String title;

    @ApiModelProperty(value = "类型")
    private Integer type;

    @ApiModelProperty(value = "运营商")
    private Integer operators;

    @ApiModelProperty(value = "地区")
    private String regions;

    @ApiModelProperty(value = "商品面值(价格)")
    private BigDecimal amount;

    @ApiModelProperty(value = "是否有效 0是未上架 1是上架")
    private Boolean isValid=false;

    @ApiModelProperty(value = "0未删除，1已经删除")
    private Boolean delFlag=false;

    public BusinessGoodsDto toDto(){
        BusinessGoodsDto dto=new BusinessGoodsDto();
        BeanUtils.copyProperties(this,dto);
        dto.setRouteList(new ArrayList<>());
        return dto;
    }
}
